/*
package com.taikang.tkbackend.config.cros;


import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
//
@WebFilter(urlPatterns = "/*")
public class CrosFilter implements Filter {

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        if (servletResponse instanceof HttpServletResponse) {
            HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
            HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
            httpServletResponse.setCharacterEncoding("UTF-8");
            httpServletResponse.setContentType("application/json; charset=utf-8");
            httpServletResponse.setHeader("Access-Control-Allow-Credentials", "true");
           */
/* httpServletResponse.setHeader("Access-Control-Allow-Origin", httpServletRequest.getHeader("Origin"));*//*

            httpServletResponse.setHeader("Access-Control-Allow-Headers", "platform,system_version,device_brand,device_model,app_version, Authorization,Origin, X-Requested-With, content-type,Token,Accept, Connection, User-Agent, Cookie, id,Referer");
            httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
            httpServletResponse.setHeader("Access-Control-Expose-Headers", "X-Access-Token");
        }
        filterChain.doFilter(servletRequest, servletResponse);
    }
}
*/
